package practice.test3.studentRecord.plan1;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class ScoreMapper extends Mapper<LongWritable,Text,Text,Text> {

    private String fileName;
    private Text outK = new Text();
//    private StuBean stuBean = new StuBean();


    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {

        //`\\`进行字符转义
        String[] split = value.toString().split("\\|");

        //把姓名作为outK传出
        outK.set(split[1]);

        context.write(outK,value);

    }
}
